package cn.mastor.org.service.impl;

import cn.mastor.basic.service.impl.BaseServiceImpl;
import cn.mastor.org.domain.Sdictionarydetail;
import cn.mastor.org.mapper.DictionarydeMapper;
import cn.mastor.org.service.ISdictionarydetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;

@Service
@Transactional(readOnly = true,propagation = Propagation.SUPPORTS)
public class SdictionarydetailServiceImpl extends BaseServiceImpl<Sdictionarydetail> implements ISdictionarydetailService {
    @Autowired
    private DictionarydeMapper dictionarydeMapper;
    @Override
    public List<Sdictionarydetail> LowDeper(Long id) {
        List<Sdictionarydetail> all = dictionarydeMapper.findAll();
        List<Sdictionarydetail> result = new ArrayList<>();
        for (Sdictionarydetail dept:all){
            if (id == dept.getTypesId()){
                Sdictionarydetail byId = dictionarydeMapper.findById(dept.getId());
                result.add(byId);
            }
        }
        return result;
    }
    @Override
    public void deleteby(Long id) {
        dictionarydeMapper.deleteby(id);
    }
}
